
#include "ednn_flatten.h"



static ednn_ret flatten_build(struct ednn_layer *layer)
{
    struct ednn_layer *prev = ednn_list_entry(layer->list.prev, 
        struct ednn_layer, list);
    
    /* create curr layer's output tensor */
    ednn_shape_t dim[2] = {ednn_tensor_size(prev->output), 0};
    layer->output = ednn_tensor_create(dim, 1);

    return ednn_ok;
}

static ednn_ret flatten_forward(struct ednn_layer *layer)
{
    return ednn_ok;
}

struct ednn_layer *ednn_flatten_layer(void)
{
    struct ednn_layer *layer = ednn_mem_zalloc(sizeof(struct ednn_layer));
    ednn_assert(layer != EDNN_NULL);

    layer->type    = EDNN_LAYER_FLATTEN;
    layer->forward = flatten_forward;
    layer->build   = flatten_build;

    return layer;
}